<?php

namespace App\Http\Controllers\Home;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use DB;

class IndexController extends Controller
{
    //index
    public function index()
    {

    	$IP = $_SERVER["REMOTE_ADDR"];
    	
		if($IP =='127.0.0.1')
		{
//开始
			$title = '前台首页';
    		$res = DB::table('brand') ->where('show',1)->limit(6)->get();
        
        	return view('home.index.index',['title'=>$title,'data'=>$res]);
//结束
		}else
			{	
				echo "未满十八岁禁止入内！！";
			}
    }
}
